package com.ruoyi.documents.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.documents.mapper.DocProjectMapper;
import com.ruoyi.documents.domain.DocProject;
import com.ruoyi.documents.service.IDocProjectService;

/**
 * 项目信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-18
 */
@Service
public class DocProjectServiceImpl implements IDocProjectService 
{
    @Autowired
    private DocProjectMapper docProjectMapper;

    /**
     * 查询项目信息
     * 
     * @param id 项目信息主键
     * @return 项目信息
     */
    @Override
    public DocProject selectDocProjectById(Long id)
    {
        return docProjectMapper.selectDocProjectById(id);
    }

    /**
     * 查询项目信息列表
     * 
     * @param docProject 项目信息
     * @return 项目信息
     */
    @Override
    @DataScope(deptAlias = "t", userAlias = "t")
    public List<DocProject> selectDocProjectList(DocProject docProject)
    {
        return docProjectMapper.selectDocProjectList(docProject);
    }

    /**
     * 新增项目信息
     * 
     * @param docProject 项目信息
     * @return 结果
     */
    @Override
    public int insertDocProject(DocProject docProject)
    {
        docProject.setCreateTime(DateUtils.getNowDate());
        return docProjectMapper.insertDocProject(docProject);
    }

    /**
     * 修改项目信息
     * 
     * @param docProject 项目信息
     * @return 结果
     */
    @Override
    public int updateDocProject(DocProject docProject)
    {
        docProject.setUpdateTime(DateUtils.getNowDate());
        return docProjectMapper.updateDocProject(docProject);
    }

    /**
     * 批量删除项目信息
     * 
     * @param ids 需要删除的项目信息主键
     * @return 结果
     */
    @Override
    public int deleteDocProjectByIds(Long[] ids)
    {
        return docProjectMapper.deleteDocProjectByIds(ids);
    }

    /**
     * 删除项目信息信息
     * 
     * @param id 项目信息主键
     * @return 结果
     */
    @Override
    public int deleteDocProjectById(Long id)
    {
        return docProjectMapper.deleteDocProjectById(id);
    }
}
